package com.whz.mlc.queue;

import com.whz.generic.memqueue.MessageConsumer;
import com.whz.generic.memqueue.configure.MemQueueProperty;
import com.whz.generic.memqueue.disruptor.MemDisruptorQueue;
import lombok.extern.slf4j.Slf4j;

/**
 * 简单内存消费队列
 *
 * @author whz
 */
@Slf4j
public class SimpleMemQueue implements SimpleQueue {
    public static final SimpleQueue DEFAULT_QUEUE = new SimpleMemQueue();

    public final MemDisruptorQueue queue;

    private SimpleMemQueue() {
        queue = new MemDisruptorQueue(new MemQueueProperty());
    }

    @Override
    public void send(Object o) {
        queue.send(o);
    }

    @Override
    public void addConsumer(MessageConsumer consumer) {
        queue.addConsumer(consumer);
    }
}